 {extend name="layout:base" /}{block name="content"}

 <?php
$global=isSupperManagerForSession();
 ?>
 <link rel="stylesheet" type="text/css" href="/static/My97DatePicker/skin/WdatePicker.css" />
 <script charset="utf-8" src="/static/My97DatePicker/WdatePicker.js"></script>
<style type="text/css">
.yg_inp>input{margin-bottom: 10px;}
#zc_detail table{margin:10px;}
#zc_detail table tr td{
    border: 1px solid #ddd;
    height:40px;
    line-height:40px;
    padding-left:5px;
    padding-right:5px;
}
.ordertable input {width:90%;}
.table tr th{text-align:center;}
</style>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="/static/ueditor/lang/zh-cn/zh-cn.js"></script>


<section class="topBanners">
         <div class="icon"></div>
         <div class="topBannersNav">
        <span data-url="/admin/payorder/lists" onclick="ContentLoadGo('/admin/payorder/lists')">订单管理</span>
         >
         <span data-url="/admin/payorder/infoData"  onclick="ContentLoadGo('/admin/payorder/infoData?id=<?php echo $id; ?>')"  >详情</span>
         
         </div>
</section>
 <section id="zc_detail">
     <input type="hidden" value="<?php echo $id; ?>" id="editId" />
     <table class="ordertable" border="0" cellspacing="0" style="width:98%;margin-bottom:50px;" cellpadding="0">
         <tr>
             <td><div align="right">订单号</div></td>
             <td>
                 <?php echo $info['order_sn']; ?>
             </td>
             <td><div align="right">订单金额</div></td>
             <td>
                 <?php echo $info['money']; ?>元
             </td>
             <td><div align="right">优惠金额</div></td>
             <td>
                 <?php echo $info['coupon_money']; ?>元
             </td>

             <td><div align="right">订单状态</div></td>
             <td>
                 <?php echo $info['statsMapper']; ?>
             </td>
         </tr>
         <tr>
             <td><div align="right">下单时间</div></td>
             <td>
                 <?php echo $info['ctime']; ?>
             </td>
             <td><div align="right">下单人</div></td>
             <td>
                 <?php echo $info['UserInfo']['nickname']; ?>
                 [<?php echo $info['UserInfo']['uname']; ?>]
             </td>
             <td><div align="right">付款方式</div></td>
             <td>
                 <?php  echo $info['paytypeMapper']; ?>
             </td>
             <td><div align="right">付款时间</div></td>
             <td>
                 <?php  if($info['ptime']!="0000-00-00 00:00:00"){echo $info['ptime'];} ?>
             </td>

         </tr>
         <tr>
             <td><div align="right">商品信息</div></td>
             <td colspan="7">
                 <?php
                  $goodString="";
                 if($info['ty']==1)
                 {

                    foreach($info['goodLists'] as $k=>$v) {
                        $goodString .=$v["name"]." [".$v['buy_money']."*".$v['buy_num']."] ".$v['buy_good_attr']."<br>";
                      }

                   }
                  else if($info['ty']==2){
                            $goodString .=$info['devInfo']["device_sn"]." [".$info['devInfo']["device_model"]."]";
                   }

                 echo $goodString;
                 ?>

             </td>
         </tr>



         <?php
if($info['ty']==1){
        ?>
         <tr>
             <td><div align="right">收货人信息</div></td>
             <td colspan="7">
              收货人：<?php echo $info['t_name']?><br>
              联系电话：<?php echo $info['t_phone']?><br>
              区域：<?php echo $info['t_provice']." ".$info['t_city']." ".$info['t_area'];?><br>
              详细地址：<?php echo $info['t_address']?><br>
              邮编：<?php echo $info['t_zipcode']?>
             </td>
         </tr>

         <tr>
             <td><div align="right">物流信息</div></td>
             <td colspan="7">
                 物流名称：<?php echo $info['express_type']?><br>
                 物流单号：<?php echo $info['express_no']?><br>
                 发货时间：<?php echo $info['fhtime']?><br>
             </td>
         </tr>
         <tr>
             <td><div align="right">买家留言</div></td>
             <td colspan="7">
                 <?php
                   echo $info['user_memo'];
                 ?>

             </td>
         </tr>
         <tr><td colspan="8" style="text-align:center;">
             <?php
                if($info['status']==0)
                {
                ?>
             <input type="button" power="70000"  style="width:80px;margin-top:4px;margin-bottom:4px;padding:0px;" value="关闭" class="link_btn orderClose"/>

             <?php
                }
                else if($info['status']==1)
                {
                ?>
             <input type="button" power="70000"  style="width:80px;margin-top:4px;margin-bottom:4px;padding:0px;" value="发货" class="link_btn fahuo"/>
             <?php
                }
                else if($info['status']==2)
                {
                ?>
             <input type="button" power="70000"  style="width:120px;margin-top:4px;margin-bottom:4px;padding:0px;" value="修改物流信息" class="link_btn updateWuLiu"/>
             <input type="button" power="70000"  style="width:120px;margin-top:4px;margin-bottom:4px;padding:0px;" value="确认收货" class="link_btn comfireShouhuo"/>
             <?php
                }

             ?>

         </td></tr>
         <?php
}else
{
?>
         <tr>
             <td><div align="right">设备状态</div></td>
             <td colspan="7">
                 <?php
                 if($info['status']==3)
                 {
                    if($info['is_device_del']==0){
                        echo "使用中";
                    }else   if($info['is_device_del']==1){
                        echo "使用完毕";
                    }
                  }
               ?>
             </td>
         </tr>
         <?php
}
 ?>




     </table>

     <div style="width:98%;height:30px;font-size:16px;padding-left:18px;">跟踪：</div>
     <div id="orderLog" style="width:98%;margin-left:auto;margin-right:auto;line-height: 30px;font-size:16px;border:1px solid #ccc;padding:10px 0px;">
         <?php
            foreach($orderLogLists as $k=>$v)
         {
         ?>
         <div id="orderLogItem" style="width:100%;margin-left:auto;margin-right:auto;line-height: 30px;height:30px;padding-left:10px;">
             <span style='margin-right:10px;'><?php echo $v['ctime']; ?></span>
             <span style='margin-right:10px;'><?php echo $v['op_username']; ?></span>
             <span style='margin-right:10px;'><?php echo $v['act']; ?></span>
         </div>
         <?php
            }
         ?>
     </div>

 </section>
</script>
<script type="text/javascript">
function myResearch(){
   var url="/admin/payorder/infoData";
   var id=$("#editId").val();
   ContentLoadGo(url+"?id="+id);
}

$(function(){

   $(".info").click(function(){
       var that =this;
       var url="/admin/payorder/infoData";
       var id=$(that).parent().parent().attr('data-id');
       var param={
               id:id
       };
       ContentGet(url,param)
   });


    $(".orderClose").unbind().bind("click",function(){
        var that =this;
        var url="/admin/payorder/close";
        var id="<?php echo $id; ?>";
        var param={
            id:id
        };
        cofirmsss_tishi(1,'您确定要执行该操作吗？',function(id){

            AjaxRequest(url,param,function(data){
                if(data.err==0)
                {
                    SuccessTiShi("操作成功");

                    myResearch();
                }
                else
                {
                    ErrTiShi(data.msg);
                }
            });

        });
    });

    $(".comfireShouhuo").unbind().bind("click",function(){
        var that =this;
        var url="/admin/payorder/comfireShouhuo";
        var id="<?php echo $id; ?>";
        var param={
            id:id
        };
        cofirmsss_tishi(1,'您确定要执行该操作吗？',function(id){

            AjaxRequest(url,param,function(data){
                if(data.err==0)
                {
                    SuccessTiShi("操作成功");

                    myResearch();
                }
                else
                {
                    ErrTiShi(data.msg);
                }
            });

        });
    });



    //发货
    $(".fahuo").click(function(){
        var that =this;
        var url="/admin/payorder/fahuo";
        var id="<?php echo $id;?>";//ID如果是编辑可以传入ID 如果是添加为0

        var param={
            id:id
        };
        MyContentLoad(url,param);
    });

    //修改物流信息
    $(".updateWuLiu").click(function(){
        var that =this;
        var url="/admin/payorder/updateWuLiu";
        var id="<?php echo $id;?>";//ID如果是编辑可以传入ID 如果是添加为0

        var param={
            id:id
        };
        MyContentLoad(url,param);
    });



   $(".topBannerItem").click(function(){
       var attArr = $(this).attr();
       goToSelfLink(attArr);
   });
});
</script>
{/block}
	  